package test;


import VO.SellListVO;
import dao.CommodityDao;
import dao.impl.CommodityDaoImpl;
import entity.Commodity;
import entity.SellList;
import entity.Staff;
import entity.Supplier;
import org.junit.Test;
import service.*;
import service.impl.SellListServiceImpl;
import service.impl.StaffServiceImpl;
import service.impl.SupplierServiceImpl;

import java.util.List;

public class test {
    @Test
    public void test01(){
        Supplier supplier = new Supplier();
        supplier.setSuid(6);
        supplier.setSuname("旺仔牛奶浙江台州分公司");
        supplier.setSuaddress("浙江台州鑫盛大街126号");
        supplier.setSutel("18956742558");
        new SupplierServiceImpl().addSupplier(supplier);
    }

    @Test
    public void test02(){
        StaffService staffService = new StaffServiceImpl();
        List<Staff> allStaffs = staffService.getAllStaffs();
        for (Staff staff : allStaffs){
            System.out.println(staff);
        }
    }

    @Test
    public void test03(){
        SellListService sellListService = new SellListServiceImpl();
        SellList sellList = new SellList();
        sellList.setCid(5);
        sellList.setClid(2);
        sellList.setCount(100);
        sellList.setSid("102");
        sellListService.addSellList(sellList);
    }

    @Test
    public void test04(){
        SellListService sellListService = new SellListServiceImpl();
        List<SellListVO> sells = sellListService.getAllSells();
        for(SellListVO sellListVO : sells){
            System.out.println(sellListVO);
        }
    }

    @Test
    public void test05(){
        SupplierService supplierService =  new SupplierServiceImpl();
        List<Supplier> allSuppliers = supplierService.getAllSuppliers();
        for(Supplier supplier : allSuppliers){
            System.out.println(supplier);
        }
    }



}
